<?php
namespace app\admin\validate;

use think\Validate;

class OrderValidate extends Validate
{
    protected $rule =   [
        'id'          => 'require|number',
        'page'        => 'require|number',
        'limit'       => 'require|number',
        'nickname'    => 'require|length:1,30',
        'phone'       => 'require|length:1,30',
    ];
    
    protected $message  =   [
        'id.require'          => 'ID必须',
        'id.number'           => 'ID必须是数字',
        'page.require'        => '页数不能为空',
        'page.number'         => '页数数据类型错误',
        'limit.require'       => '条数不能为空',
        'limit.number'        => '条数数据类型错误',
        'nickname.require'    => '用户昵称不能为空',
        'nickname.number'     => '用户昵称长度错误',
        'phone.require'       => '手机号不能为空',
        'phone.number'        => '手机号长度错误',
    ];
    
    protected $scene = [
        'show'         => ['id'],
        'list'         => ['page', 'limit'],
    ];
}